package com.netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * @author CHL
 * @ClassName: ReceiverRegistryHandler
 * @Description: 消费端元数据注册
 * @date 2022/12/30 16:23
 * @Version 1.0
 */

public class ReceiverRegistryHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        RegistryProtocol registryProtocol = new RegistryProtocol();
        registryProtocol.setConsumerHost("localhost");
        registryProtocol.setConsumerPort(8001);

        ctx.channel().writeAndFlush(registryProtocol);
    }

}
